import java.util.Scanner;

public class demo05 {
    //饮料换购
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int sum=n;
        while (n>=3){
            int num=n/3;
            sum+=num;
            n=n%3+num;
        }
        System.out.println(sum);
    }
}
